package com.link.base.base.appinfo.service;

import com.link.base.base.appinfo.model.AppMobileInfo;
import com.link.base.base.appinfo.model.AppMobileUser;
import com.link.base.base.appinfo.model.AppVersion;
import com.link.base.base.appinfo.model.LoadFlag;
import com.link.core.basic.service.BasicService;

import java.util.List;
import java.util.Map;

/**
 * 设备管理
 *
 * @author ouyangzhenqiang
 * @date 2018/10/16
 */
public interface AppMobileInfoService extends BasicService<AppMobileInfo> {
    /**
     * 获取设备统计数据
     *
     * @author ouyangzhenqiang
     * @date 2018/10/16
     * @param record
     */
    Map<String, Object> queryDeviceNumber(AppMobileInfo record) throws Exception;
    
    /**
     * 获取设备新增和活跃数据
     * 
     * @author ouyangzhenqiang
     * @date 2019/08/29 10:28
     */
    Map<String, Object> queryNewOrLiveNumber(AppMobileInfo record) throws Exception;

    /**
     * 工作流刷新活跃设备数据
     *
     * @author ouyangzhenqiang
     * @date 2019/09/19 17:43
     */
    void refreshLiveNumber() throws Exception;

    /**
     * 获取机型分布
     *
     * @author ouyangzhenqiang
     * @date 2019/08/29 10:28
     */
    Map<String, Object> queryMobileTypeNumber(AppMobileInfo record) throws Exception;

    /**
     * 获取地区分布
     *
     * @author ouyangzhenqiang
     * @date 2019/08/29 10:28
     */
    Map<String, Object> queryProvinceNumber(AppMobileInfo record) throws Exception;

    /**
     * 注册
     *
     * @author ouyangzhenqiang
     * @date 2018/10/16
     * @param record AppMobileInfo
     */
    void submit(AppMobileInfo record) throws Exception;

    /**
     * 清空用户和设备之间的关联
     *
     * @author ouyangzhenqiang
     * @date 2018/10/16
     * @param  record
     */
    void clearUser(AppMobileInfo record) throws Exception;

    /**
     * 获取设备信息
     *
     * @author ouyangzhenqiang
     * @date 2018/10/16
     * @param  record
     */
    List<AppMobileInfo> getMobileInfo(AppMobileInfo record) throws Exception;

    /**
     * 获取版本信息
     *
     * @author ouyangzhenqiang
     * @date 2018/10/16
     * @param  appId
     */
    AppVersion getAppVersion(String appId) throws Exception;

    /**
     * 查询数据库检测表，用于判断是否需要重新加载基础数据
     *
     * @author ouyangzhenqiang
     * @date 2018/10/16
     * @param  temp
     */
    List<LoadFlag> getLoadDataFlag(LoadFlag temp) throws Exception;

    /**
     * 获取设备登录历史用户
     *
     * @author ouyangzhenqiang
     * @date 2019/11/28 18:08
     */
    List<AppMobileUser> mobileUserList(AppMobileUser record) throws Exception;

}
